import request from "./request"

// 通过关键字搜索 keyword GET
export const searchByKeyword = async(keyword)=>{
  try {
    return await request({
      url:"/rubbish_classify",
      method:"GET",
      data:{
        keyword
      }
    })
  } catch (error) {
    console.log(error);
  }
}

// 通过图片搜索 base64格式的image POST
export const searchByImage = async(image)=>{
  try {
    return await request({
      method:"POST",
      url:"/img_classify",
      data:{
        image
      }
    })
  } catch (error) {
    console.log(error);
  }
}